function [ filter, thick ] = spektrInherentFiltrationDisplay( InhArr )
%%**************************************************************************
%% System name:      SPEKTR
%% Module name:      Inhdisplay.m
%% Version number:   3
%% Revision number:  00
%% Revision date:    15-Jun-2015
%%
%% 2016 (C) Copyright by Jeffrey H. Siewerdsen.
%%          I-STAR Lab
%%          Johns Hopkins University
%%
%%  Usage: uniqueFilt = spektrInherentFiltrationDisplay( name_of_spektr_tube_used)
%%
%%  Inputs:
%%      tubeName - The name of the tube that is being used to generate the
%%                 spectrum within the GUI. This variable is a string.
%%
%%  Outputs:
%%      A unique list of the filtration elements contained within the tube
%%      along with their thicknesses.
%%
%%  Description:
%%      This helper function will pass on the inherent filtration of the selected
%%      tube to the GUI to be displayed in listbox 8 and 9.
%%
%%  Notes:
%%
%%*************************************************************************
%% References:
%%
%%*************************************************************************
%% Revision History
%%  3.000    2015 06 15     JP  Initial code
%%*************************************************************************


%INHDISPLAY obtains the tube settings and displays the element in listbox
%8 if the element is unique in the list and thickness in listbox 9 if the
%thickness of the element is not 0 mm.
Al_inherent = 1.6;
InhArr = cat(1, InhArr, [13, Al_inherent]);

ind = unique(InhArr(:, 1));
val = accumarray(InhArr(:, 1), InhArr(:, 2));
val = val(ind);
filter_list = [ind, val];
filter_list = filter_list((filter_list(:, 2) ~= 0), :);

if isempty(filter_list)
    filter = {};
    thick = {};
else
    filter = arrayfun(@spektrElement2Z, filter_list(:,1), UniformOutput=false);
    thick = cellstr(num2str(filter_list(:, 2)));
end